<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <script src="https://cdn.staticfile.org/vue/2.2.2/vue.min.js"></script>
    <title>Document</title>
</head>
<body>
<div id="app">
    姓：<input type="text" v-model="firstName">
    名：<input type="text" v-model="lastName">
    全名：<input type="text" v-model="fullName">
</div>
<script>
    const vm = new Vue({
        el: '#app',
        data: {
            firstName:'白',
            lastName:'优秀',
        },
        computed:{
            // fullName:{
            //     get(){
            //         console.log('get 被调用啦')
            //         return this.firstName + this.lastName
            //     },
            //     set(val){
            //         console.log('set 被调用啦')
            //         const name = val.split('-')
            //         console.log(name)
            //         this.firstName = name[0]
            //         this.lastName = '棒'
            //     }
            // }
            fullName(){
                console.log('get 被调用啦')
                return this.firstName + this.lastName
            }

        },
        methods:{
        }
    })

</script>
</body>

</html>
